Computer source code is typically written using a high level computer language. Examples of high level languages include C++, JAVA, FORTRAN, etc. Once written, source code is converted into object or machine code, which can be executed by a computer. A computer program called a compiler program receives as input source code and generates as output object code which may be loaded into the computer memory and executed.
Often, the source code will contain “bugs”. Bugs are logical errors in the original source code that cause unexpected results during the execution of the object code. These unexpected results may cause the computer executing the object code to generate unintended output and erroneous data, or to terminate prematurely.
Before releasing any set of computer code, software manufacturers test their code rigorously. Ideally, every set of code should be 100% tested prior to release so that once released, the computer code will not experience any errors. From a practical standpoint, however, this is extremely difficult if not impossible. To do so would require more resources (both in terms of human resources and actual costs) than would be practicable to expend. As a result, most manufacturers settle for a compromise. So long as the testing of a set of code has reached a certain threshold (e.g. 85% of the code has been executed and tested), the code is deemed ready for release.
To determine whether a set of code has been sufficiently tested, manufacturers generally run tests on the code, and generate test coverage data based upon the tests. Basically, the coverage data specifies which lines of source code were executed during the tests, and what percentage of the lines of source code were actually executed and tested. Based upon the coverage data, the manufacturer determines whether the set of code has been sufficiently tested.
Currently, software tests locate untested portions of code, and subsequent tests are created to test some of these portions. However, current methods employ a “smoke” approach, whereby tests are created for randomly selected untested sets of code. This process is very inefficient, usually results in a small incremental increase in the total amount of code tested and is ineffective for debugging a body of code.
Because of the shortcomings of the current methods, there exists a need for an improved mechanism which enables computer code to be tested more efficiently.